package com.itaq.cheetah.serviceA.controller;

import com.itaq.cheetah.serviceA.model.dto.SsoClientDetailDTO;
import com.itaq.cheetah.serviceA.model.entity.SsoClientDetail;
import com.itaq.cheetah.serviceA.model.result.WrapperResult;
import com.itaq.cheetah.serviceA.service.ISsoClientDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;


@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/platform")
@Api(tags = "生成平台秘钥")
public class PlatformSecretController {

    private final ISsoClientDetailService iSsoClientDetailService;

    /**
     * 保存平台信息
     * @return 平台信息
     */
    @ApiOperation("保存平台信息")
    @PostMapping("/save")
    public WrapperResult<SsoClientDetail> save(@RequestBody SsoClientDetailDTO ssoClientDetailDTO) {
        SsoClientDetail ssoClientDetail = iSsoClientDetailService.saveClient(ssoClientDetailDTO);
        return WrapperResult.success(ssoClientDetail);
    }

}
